/*
 * ChannelCommon.h
 *
 */

#ifndef CHANNELCOMMON_H_
#define CHANNELCOMMON_H_

#include <iostream>
#include <cstddef>

//TODO ver si es necesario, eliminar de ser posible
#define TAM_BUFFER 2048

#define TAM_PDU_CANAL 1024
#define TAM_RECEIVER_NAME 10
#define TAM_HEADER_CANAL ( 2 * sizeof(char) + 3 * sizeof(int) )

namespace channel{

static std::string nameToMtypeFilepathAgente="/tmp/channel_to_mtype_agente";
static std::string nameToMtypeFilepathBroker="/tmp/channel_to_mtype_broker";

typedef struct
{
	char channelName[100];
} StartComunicationMessage;

typedef struct
{
	int numero;
} VendedorLibreMessage;


typedef struct
{
	int id;
} HandShakeMessage;

typedef enum {REGISTER=0,
				MQ_MESSAGE,
				SHMEM_MSG,
				CHANNEL_END_MSG}ChannelMessageType;

struct ChannelMessage
{
	int destino;
	ChannelMessageType tipo;
	size_t size;
	char payload[TAM_PDU_CANAL];
};

}
#endif /* CHANNELCOMMON_H_ */
